package com.jielihaofeng.level2;

/**
 * @author Johnnie Wind
 * @description 类型推断和显示类型声明
 * @date 2021/11/30 11:51
 */
public class Test<T> {

    public void println(T t) {
        System.out.println(t);
    }

    public static void main(String[] args) {
        Test test = new Test();
        String str = "hello";
        // 类型推断
        test.println(str);
        // 显示类型声明
        test.<String> println(str);

    }

}
